import AniBox from '../libs/AniBox.esm.js'
import { zrender } from '../libs/zrender-helper.js'
import store from '../store/index.js'
import { createEne } from './ene.js'

const init = () => {
  const { stage,main } = store.state;
  let config = store.state.config.enemy;
  let enemy = new AniBox({
    data(){
      return {
      }
    },
    created(){
      this.autoProduce();
    },
    methods : {
      produce(){
        let ene = createEne();
        this.add(ene);
      },
      autoProduce(){
        this.intervalTime(config.itime,res => this.produce());
      }
    },
    step(){
    },
    render(){
    
    }
  })
  stage.add(enemy);
  store.state.enemy = enemy;
}

export { init };
